/*
*	Project: Aethon
*
*	File: PhysicsManager.h
*
*	Author: Jonathan Hersack
*
*	Date: 2/15/2009
*
*   Purpose: The PhysicsManager updates and validates all of the model movements
*   and determines collisions
*/

#ifndef PHYSICSMANAGER_H_
#define PHYSICSMANAGER_H_

#include "../include/vector3f.h"
#include "../include/Model.h"
#include "../include/Terrain.h"


class PhysicsManager{

    
    bool hasGravity;  
	bool hasCollisions;
	
	public:
	
	PhysicsManager()
    {
		hasGravity = false;
		hasCollisions = true;
	}//end constructor
	
	//void modelCollisions();
	//void terrainCollisions();
	vector3f generateNewPosition(Model *modelA, vector3f tempVel);
	void update(vector<Model> *modelListPtr, Terrain *terrainPtr);
	//void reactTerrainCollision(Model model);
	vector3f normalizeVector(vector3f vect);
	vector3f reactModelCollision(Model *model, vector3f tempVel, vector3f tempPos);
	void updateModelPosition(Model *modelAPtr, vector3f tempPos);
	void modelCollision(vector<Model> *modelListPtr);
	void terrainCollision(vector<Model> *modelListPtr,Terrain *terrainPtr);
	//void reactGravity(Model model);
	
	//gets and sets-----------------------------------------------------------
   	
	void setHasGravity(bool grav)
	{
         hasGravity = grav;
    }//end setHasGravity
    
	bool getHasGravity()
	{
         return hasGravity;
    }//end getHasGravity
    
   	void setHasCollisions(bool collision)
	{
         hasCollisions = collision;
    }//end setcollisions
	
	bool getHasCollisions()
	{
         return hasCollisions;
    }//end getcollisions
    
};//end class

#endif //PHYSICSMANAGER_H_

